<?php
session_start();
$host = "localhost";
$user = "root";
$pass = "";
$db ="eeg";
$koneksi = mysql_connect($host, $user, $pass);
if (!$koneksi) {
echo "Koneksi ke server tidak berhasil";
};
$database = mysql_select_db($db);
if (!$database) {
echo "Koneksi ke database tidak berhasil";
}
mysql_select_db($db) or die ("Database not Found !");
?>
<HTML>
<CENTER><div id="container">
	<div id="content">
		<div class="col2">
		<head> 
<meta charset="utf-8"> 
<title>Database Aritmatika</title> 
<meta name="description" content="Database Aritmatika">
<link href="bootstrap/css/bootstrap.css" rel="stylesheet"> 
</head>
<body>
<h5>Halaman</h5>
<?php 
$carisesi= $_SESSION['carisesibil'] ;
$sql = "SELECT COUNT(Sesi) FROM mct1d1 where Sesi='$carisesi'"; 
$rs_result = mysql_query($sql); 
$row = mysql_fetch_row($rs_result); 
$total_records = $row[0]; 

$total_pages = ceil($total_records / 50); 
  
for ($i=1; $i<=$total_pages; $i++) { 
            echo "<font size ='5pt' colour = 'black'><a  href='bilateraltest1.php?page=".$i."'>".$i."</a> "; 
}; 


?>

<br><br>
<a href="lamda.php"><button class="btn btn-small"  ><i class="icon-arrow-left" ></i> Kembali</button></a>
<a href="excel3.php"><button class="btn btn-small"  ><i class="icon-arrow-left" ></i> Export</button></a>
<center><h1>
<?php
echo $carisesi;
echo '<br>3%';

?></h1></center>
<table class="table table-striped">
	<thead>
          <tr>
            <th>No</th>
            <th>Theta</th>
            <th>Alpha</th>
            <th>Beta</th>
			<th>Low Alpha</th>
			<th>High Apha</th>
			<th>Low Betha</th>
			<th>High Betha</th>
		
			
          </tr>
        </thead>
<?php


if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$start_from = ($page-1) * 50; 
$sql = "SELECT * FROM mct1d1 where Sesi='$carisesi' LIMIT $start_from, 50"; 
$rs_result = mysql_query ($sql); 

$query = "SELECT * FROM mct1d1 where Sesi='$carisesi'";
$query = mysql_query( $sql );
if(!$query){
    die( mysql_error() );
}
$pertama =-2.481078088;
$kedua =2.481078088;
while( $rows = mysql_fetch_row($query) ){
    ?>
    

		<tbody>
          <tr>
            
            <td><?php
    echo $rows[1];
    ?> </td>
            <td><?php
	if($pertama < $rows[2]){
	
	if ($rows[2]<$kedua)
	
	{
	
	echo 'normal';
	}
	else {echo 'lelah';}
	}
	else {echo 'lelah';}
	?>
	</td>
	<td><?php
	if($pertama < $rows[3]){
	
	if ($rows[3]<$kedua)
	
	{
	
	echo 'normal';
	}
	else {echo 'lelah';}
	}
	else {echo 'lelah';}
	?></td>
	
	<td><?php
	if($pertama < $rows[4]){
	
	if ($rows[4]<$kedua)
	
	{
	
	echo 'normal';
	}
	else {echo 'lelah';}
	}
	else {echo 'lelah';}
	?></td>
	<td><?php
	if($pertama< $rows[5]){
	
	if ($rows[5]<$kedua)
	
	{
	
	echo 'normal';
	}
	else {echo 'lelah';}
	}
	else {echo 'lelah';}
	?></td>
	<td><?php
	if($pertama < $rows[6]){
	
	if ($rows[6]<$kedua)
	
	{
	
	echo 'normal';
	}
	else {echo 'lelah';}
	}
	else {echo 'lelah';}
	?></td>
	<td><?php
	if($pertama < $rows[7]){
	
	if ($rows[7]<$kedua)
	
	{
	
	echo 'normal';
	}
	else {echo 'lelah';}
	}
	else {echo 'lelah';}
	?>	</td>
	
	<td><?php
	if($pertama < $rows[8]){
	
	if ($rows[8]<$kedua)
	
	{
	
	echo 'normal';
	}
	else {echo 'lelah';}
	}
	else {echo 'lelah';}
	
	
	
	}
	
	
	
	
    
	
    ?>	</td
	</tr>
            
         
		  
		  
	
  
  

 
	 </tbody>
      </table>
</body>
</html>

</div></CENTER>
</div>
</HTML>
<!DOCTYPE html> 
<html lang="en"> 

</body>
</html>